Skip to content

Add configurable close confirmation settings#2609

Open
arieltobiana wants to merge 3 commits intomanaflow-ai:mainfrom
arieltobiana:feat/configurable-close-confirmations
Open

Add configurable close confirmation settings#2609
arieltobiana wants to merge 3 commits intomanaflow-ai:mainfrom
arieltobiana:feat/configurable-close-confirmations

Conversation

@arieltobiana
Copy link
Copy Markdown
Contributor

@arieltobiana arieltobiana commented Apr 5, 2026

Summary

  • Add 4 new independently togglable close confirmation settings in Settings > App
  • Each confirmation type can be turned on/off without affecting the others
  • All default to enabled, preserving existing behavior

New settings

Setting UserDefaults Key Controls
Confirm Close Running Process confirmCloseRunningProcess Workspace close when a command is running
Confirm Close Pinned Workspace confirmClosePinnedWorkspace Pinned workspace close confirmation
Confirm Close Window confirmCloseWindow Window close with workspaces
Confirm Batch Close confirmBatchClose "Close other tabs" and multi-workspace close

Settings are also configurable via defaults write:

defaults write com.cmuxterm.app confirmCloseRunningProcess -bool false

Files changed

  • Sources/cmuxApp.swift — Settings enums, @AppStorage properties, UI toggles, reset defaults
  • Sources/Workspace.swift — Gate resolveCloseConfirmation running-process case
  • Sources/TabManager.swift — Gate pinned workspace and batch close confirmations
  • Sources/AppDelegate.swift — Gate close window confirmation

Test plan

  • Build and verify no compilation errors
  • Open Settings > App and verify 4 new toggles appear below "Warn Before Quit"
  • Toggle each off and verify the corresponding confirmation dialog is skipped
  • Toggle each back on and verify confirmations return
  • Reset all settings and verify toggles return to enabled

Summary by cubic

Added four per-action toggles in Settings > App to control close confirmations. Users can turn off prompts for running processes, pinned workspaces, window close, and batch closes; defaults stay on.

  • New Features

    • Toggles: Confirm Close Running Process (confirmCloseRunningProcess), Confirm Close Pinned Workspace (confirmClosePinnedWorkspace), Confirm Close Window (confirmCloseWindow), Confirm Batch Close (confirmBatchClose).
    • Configure in-app or via defaults write com.cmuxterm.app <key> -bool <true|false>.
  • Bug Fixes

    • Batch close no longer skips per-workspace running-process confirmation when batch confirmation is off.
    • Batch close no longer bypasses pinned-workspace confirmation when batch confirmation is off.

Written for commit d11667e. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added four Settings toggles to control confirmations for closing running processes, pinned workspaces, windows, and batch closes (enabled by default).
  • Behavior Changes

    • Disabling a toggle skips the corresponding confirmation dialog.
    • Batch-close now honors the batch setting and changes per-workspace confirmation behavior.
    • Pinned-workspace prompt shown only when its confirmation setting is enabled.

Each close confirmation dialog can now be independently toggled in
Settings > App:

- Confirm Close Running Process (workspace with running command)
- Confirm Close Pinned Workspace
- Confirm Close Window
- Confirm Batch Close (multiple tabs/workspaces)

All default to enabled, preserving existing behavior. Also configurable
via `defaults write com.cmuxterm.app <key> -bool false`.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

@arieltobiana is attempting to deploy a commit to the Manaflow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 63e105a7-e7e9-41ac-8b5e-bc3ecff7ca85

📥 Commits

Reviewing files that changed from the base of the PR and between 8374bcf and d11667e.

📒 Files selected for processing (1)
  • Sources/TabManager.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • Sources/TabManager.swift

📝 Walkthrough

Walkthrough

Adds four UserDefaults-backed toggles to control close-confirmation dialogs (running processes, pinned workspaces, main window, batch closes) and gates confirmation flows in AppDelegate, TabManager, and Workspace based on those toggles.

Changes

Cohort / File(s) Summary
Settings / UI
Sources/cmuxApp.swift
Add CloseRunningProcessSettings, ClosePinnedWorkspaceSettings, CloseWindowSettings, BatchCloseSettings enums; add @AppStorage toggles in SettingsView, UI rows, and reset-to-defaults handling.
Main Window
Sources/AppDelegate.swift
confirmCloseMainWindow(_:) short-circuits to allow closing when CloseWindowSettings.isEnabled() is false (skips confirmation dialog); existing debug and alert flows otherwise unchanged.
Tab & Batch Close Logic
Sources/TabManager.swift
Gate batch confirmation with BatchCloseSettings.isEnabled(); when disabled, run per-workspace confirmation paths; gate pinned-workspace confirmation on ClosePinnedWorkspaceSettings.isEnabled() for pinned workspaces.
Workspace Running Process Check
Sources/Workspace.swift
When shellActivityState == .commandRunning, resolveCloseConfirmation(...) now returns CloseRunningProcessSettings.isEnabled() instead of a hard-coded true, leaving other states unchanged.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant SettingsView as "SettingsView\n(UserDefaults)"
  participant App as "AppDelegate"
  participant TabMgr as "TabManager"
  participant Workspace as "Workspace"

  User->>SettingsView: Toggle close-confirmation settings
  SettingsView->>SettingsView: Write to UserDefaults

  User->>App: Close main window
  App->>SettingsView: Read CloseWindowSettings.isEnabled()
  alt CloseWindowSettings disabled
    App-->>User: Close proceeds (no dialog)
  else CloseWindowSettings enabled
    App-->>User: Show confirmation dialog
  end

  User->>TabMgr: Request batch close / close others
  TabMgr->>SettingsView: Read BatchCloseSettings.isEnabled()
  alt BatchClose disabled
    TabMgr->>Workspace: Close each workspace (per-workspace confirmation may apply)
  else BatchClose enabled
    TabMgr-->>User: Show batch confirmation dialog
    TabMgr->>Workspace: Close each workspace (suppress per-workspace confirmation)
  end

  Workspace->>SettingsView: Read CloseRunningProcessSettings.isEnabled()
  alt Process running & setting enabled
    Workspace-->>User: Show running-process confirmation
  else
    Workspace-->>User: Close proceeds
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through prefs and flipped four lights,

Running, pinned, window, batch — gentler nights.
Defaults snug in nests so neat,
Confirms now follow what I tweet.
Rabbit cheers for quieter closes ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding configurable close confirmation settings across multiple dialog types.
Description check ✅ Passed The description includes a comprehensive summary with what changed and why, a detailed test plan, and references to affected files. However, it lacks explicit testing evidence and demo video evidence.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Sources/TabManager.swift (1)

2904-2915: ⚠️ Potential issue | 🟠 Major

Batch-close toggle currently suppresses running-process confirmations as a side effect.

When batch confirmation is disabled on Line 2904, the loop still closes each workspace with requiresConfirmation: false on Line 2914. That means the running-process confirmation path is bypassed for multi-workspace closes, so toggling batch-close impacts another confirmation behavior.

💡 Proposed fix
         let plan = closeWorkspacesPlan(for: workspaces)
-        if BatchCloseSettings.isEnabled() {
+        let shouldShowBatchConfirmation = BatchCloseSettings.isEnabled()
+        if shouldShowBatchConfirmation {
             guard confirmClose(
                 title: plan.title,
                 message: plan.message,
                 acceptCmdD: plan.acceptCmdD
             ) else { return }
         }

         for workspace in plan.workspaces {
             guard tabs.contains(where: { $0.id == workspace.id }) else { continue }
-            closeWorkspaceIfRunningProcess(workspace, requiresConfirmation: false)
+            closeWorkspaceIfRunningProcess(
+                workspace,
+                requiresConfirmation: !shouldShowBatchConfirmation
+            )
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sources/TabManager.swift` around lines 2904 - 2915, The batch-close toggle
currently forces requiresConfirmation: false when calling
closeWorkspaceIfRunningProcess, bypassing per-workspace running-process
confirmation; change the call so requiresConfirmation is based on
BatchCloseSettings.isEnabled() (i.e., pass requiresConfirmation:
!BatchCloseSettings.isEnabled()) so that if batch confirmation was taken no
per-workspace prompts occur, but if batch confirmation was not taken each
workspace still prompts via closeWorkspaceIfRunningProcess(workspace,
requiresConfirmation: !BatchCloseSettings.isEnabled()).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Sources/TabManager.swift`:
- Around line 2830-2839: Replace the hardcoded English title and message in the
batch-close dialog (the strings used around BatchCloseSettings.isEnabled() where
you compute count from plan.panelIds and titleLines from plan.titles and call
confirmClose) with localized ICU-style keys using String(localized: "key.name",
defaultValue: "..."), creating plural keys (e.g. "batchClose.message.one" /
"batchClose.message.other") for the count-dependent line and a localized key for
the dialog title (e.g. "batchClose.title"); update the confirmClose call to use
those localized values so the dialog uses String(localized: ..., defaultValue:
...) for both the title and the message and supports .one/.other pluralization
for English/Japanese.

---

Outside diff comments:
In `@Sources/TabManager.swift`:
- Around line 2904-2915: The batch-close toggle currently forces
requiresConfirmation: false when calling closeWorkspaceIfRunningProcess,
bypassing per-workspace running-process confirmation; change the call so
requiresConfirmation is based on BatchCloseSettings.isEnabled() (i.e., pass
requiresConfirmation: !BatchCloseSettings.isEnabled()) so that if batch
confirmation was taken no per-workspace prompts occur, but if batch confirmation
was not taken each workspace still prompts via
closeWorkspaceIfRunningProcess(workspace, requiresConfirmation:
!BatchCloseSettings.isEnabled()).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60c06ad1-f8a3-425b-bfb9-bb4696183569

📥 Commits

Reviewing files that changed from the base of the PR and between 2bf4367 and 43a21b1.

📒 Files selected for processing (4)
  • Sources/AppDelegate.swift
  • Sources/TabManager.swift
  • Sources/Workspace.swift
  • Sources/cmuxApp.swift

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

You’re at about 83% of the monthly review limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Sources/TabManager.swift">

<violation number="1" location="Sources/TabManager.swift:2830">
P2: Skipping the batch-close dialog still forces `requiresConfirmation: false`, which bypasses per-workspace running-process confirmation when batch confirmation is disabled.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 5, 2026

Greptile Summary

This PR adds 4 independently togglable close confirmation settings (confirmCloseRunningProcess, confirmClosePinnedWorkspace, confirmCloseWindow, confirmBatchClose) with a Settings UI and defaults write support. The AppDelegate, Workspace, and enum/UI changes are clean and follow existing patterns, but there is a logic bug in the batch-close path and all new UI strings are missing from Localizable.xcstrings.

  • Batch-close logic bug: In closeWorkspacesWithConfirmation, the inner loop always calls closeWorkspaceIfRunningProcess(workspace, requiresConfirmation: false) regardless of whether the batch dialog was shown. When "Confirm Batch Close" is disabled but "Confirm Close Running Process" is enabled, running processes are silently killed with no warning — contradicting the PR's claim that each setting is independent.
  • Missing localization entries: All 12 new String(localized:defaultValue:) keys are absent from Resources/Localizable.xcstrings; Japanese users will see English text for every new toggle row until added.

Confidence Score: 4/5

Two P1 findings need to be addressed before merge: a logic bug in the batch-close path and missing localization catalog entries

Most of the implementation is correct and follows established patterns; the requiresConfirmation hardcoding bug and missing Localizable.xcstrings entries are P1 issues that should be fixed first

Sources/TabManager.swift (requiresConfirmation bug in batch loop) and Sources/cmuxApp.swift (missing Localizable.xcstrings entries for 12 keys)

Important Files Changed

Filename Overview
Sources/TabManager.swift Gates batch-close and pinned-workspace confirmations behind new settings; contains P1 bug where requiresConfirmation: false is hardcoded in batch loop, silently bypassing running-process confirmations when batch close is disabled
Sources/Workspace.swift Single-line change in resolveCloseConfirmation returns CloseRunningProcessSettings.isEnabled() for commandRunning case instead of hardcoded true; correct and minimal
Sources/AppDelegate.swift Adds guard CloseWindowSettings.isEnabled() early return in confirmCloseMainWindow; clean and correct
Sources/cmuxApp.swift Adds 4 settings enums and @AppStorage bindings for new toggles following existing QuitWarningSettings pattern; 12 localization keys missing from Localizable.xcstrings

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    CW[Close Window] --> CWCheck{CloseWindowSettings\n.isEnabled?}
    CWCheck -->|false| CWSkip[Skip — close immediately]
    CWCheck -->|true| CWDlg[Show Close window? dialog]

    CP[Close Pinned Workspace] --> CPCheck{ClosePinnedWorkspaceSettings\n.isEnabled?}
    CPCheck -->|false| CPFall[Fall through to\nrunning-process check]
    CPCheck -->|true| CPDlg[Show Close pinned workspace? dialog]

    BC[Batch Close 2+ workspaces] --> BCCheck{BatchCloseSettings\n.isEnabled?}
    BCCheck -->|false| BCBug["⚠ Bug: skips batch dialog\nAND running-process check\nrequiresConfirmation: false hardcoded"]
    BCCheck -->|true| BCDlg[Show batch dialog]
    BCDlg --> BCLoop["Close each workspace\nrequiresConfirmation: false\n(correct — user already confirmed)"]

    SW[Close Single Workspace] --> RPCheck{CloseRunningProcessSettings\n.isEnabled?}
    RPCheck -->|false| RPSkip[Skip running-process dialog]
    RPCheck -->|true| RPDlg[Show Close workspace? dialog]
Loading

Comments Outside Diff (1)

  1. Sources/TabManager.swift, line 2912-2914 (link)

    P1 Running-process confirmation bypassed when batch close is disabled

    When BatchCloseSettings.isEnabled() is false, the batch dialog is skipped but closeWorkspaceIfRunningProcess is still called with requiresConfirmation: false hardcoded. A user who disables "Confirm Batch Close" but keeps "Confirm Close Running Process" enabled will silently kill running processes — contradicting the stated guarantee that each confirmation type is independent.

    When the batch dialog was shown and confirmed (isEnabled() == true), !true = false preserves the existing behavior (no second dialog per workspace). When the batch dialog is skipped (isEnabled() == false), !false = true allows each workspace to check the running-process setting individually.

Reviews (1): Last reviewed commit: "Add configurable close confirmation sett..." | Re-trigger Greptile

Comment on lines +4855 to +4901
SettingsCardRow(
String(localized: "settings.app.confirmCloseRunningProcess", defaultValue: "Confirm Close Running Process"),
subtitle: confirmCloseRunningProcess
? String(localized: "settings.app.confirmCloseRunningProcess.subtitleOn", defaultValue: "Show a confirmation before closing a workspace with a running command.")
: String(localized: "settings.app.confirmCloseRunningProcess.subtitleOff", defaultValue: "Close workspaces without confirmation, even with running commands.")
) {
Toggle("", isOn: $confirmCloseRunningProcess)
.labelsHidden()
.controlSize(.small)
}

SettingsCardDivider()

SettingsCardRow(
String(localized: "settings.app.confirmClosePinnedWorkspace", defaultValue: "Confirm Close Pinned Workspace"),
subtitle: confirmClosePinnedWorkspace
? String(localized: "settings.app.confirmClosePinnedWorkspace.subtitleOn", defaultValue: "Show a confirmation before closing a pinned workspace.")
: String(localized: "settings.app.confirmClosePinnedWorkspace.subtitleOff", defaultValue: "Close pinned workspaces without extra confirmation.")
) {
Toggle("", isOn: $confirmClosePinnedWorkspace)
.labelsHidden()
.controlSize(.small)
}

SettingsCardDivider()

SettingsCardRow(
String(localized: "settings.app.confirmCloseWindow", defaultValue: "Confirm Close Window"),
subtitle: confirmCloseWindow
? String(localized: "settings.app.confirmCloseWindow.subtitleOn", defaultValue: "Show a confirmation before closing a window with workspaces.")
: String(localized: "settings.app.confirmCloseWindow.subtitleOff", defaultValue: "Close windows without confirmation.")
) {
Toggle("", isOn: $confirmCloseWindow)
.labelsHidden()
.controlSize(.small)
}

SettingsCardDivider()

SettingsCardRow(
String(localized: "settings.app.confirmBatchClose", defaultValue: "Confirm Batch Close"),
subtitle: confirmBatchClose
? String(localized: "settings.app.confirmBatchClose.subtitleOn", defaultValue: "Show a confirmation before closing multiple tabs or workspaces at once.")
: String(localized: "settings.app.confirmBatchClose.subtitleOff", defaultValue: "Close multiple tabs or workspaces without confirmation.")
) {
Toggle("", isOn: $confirmBatchClose)
.labelsHidden()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 New localization keys missing from Localizable.xcstrings

All 12 new String(localized:defaultValue:) keys (settings.app.confirmCloseRunningProcess, .subtitleOn, .subtitleOff, and equivalents for confirmClosePinnedWorkspace, confirmCloseWindow, confirmBatchClose) are absent from Resources/Localizable.xcstrings. Per the project policy, every UI string key must be registered in the catalog with translations for all supported languages — including Japanese. Comparable existing keys (settings.app.warnBeforeQuit, settings.app.telemetry, etc.) all have full catalog entries. Until these are added, Japanese users will always see English text for all 4 new toggle rows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The String(localized:defaultValue:) keys are auto-generated by Xcode's string catalog extraction on build. Japanese translations would be a separate localization effort. Out of scope for this feature PR.

When batch confirmation is disabled, each workspace should still get its
own running-process confirmation check. Previously, requiresConfirmation
was always false after the batch dialog, which silently skipped
per-workspace checks when the batch dialog was disabled.
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Sources/TabManager.swift (1)

2866-2878: ⚠️ Potential issue | 🟠 Major

Don't skip the running-process warning after confirming a pinned close.

Passing requiresConfirmation: false here bypasses the running-process check entirely. A pinned workspace with an active command will ignore confirmCloseRunningProcess, so the new toggles are no longer independent on the single-workspace path.

💡 Proposed fix
-            closeWorkspaceIfRunningProcess(workspace, requiresConfirmation: false)
+            closeWorkspaceIfRunningProcess(workspace)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sources/TabManager.swift` around lines 2866 - 2878, The code bypasses the
running-process confirmation by calling
closeWorkspaceIfRunningProcess(workspace, requiresConfirmation: false) after a
pinned-workspace confirm; change this so the running-process check still
runs—e.g., call closeWorkspaceIfRunningProcess(workspace, requiresConfirmation:
true) or call the variant that uses the default behavior (omit the false
override) so confirmCloseRunningProcess still triggers for workspace.isPinned
paths; update the call site referencing closeWorkspaceIfRunningProcess and the
confirmClose(...) block accordingly.
♻️ Duplicate comments (1)
Sources/TabManager.swift (1)

2830-2838: ⚠️ Potential issue | 🟠 Major

Localize the new batch-close dialog strings.

This alert still hardcodes English copy. Please move the title/message to String(localized:..., defaultValue:...), add the keys to Resources/Localizable.xcstrings, and use .one / .other keys instead of manual "s" pluralization.

As per coding guidelines: “All user-facing strings must be localized using String(localized: "key.name", defaultValue: "English text") for every string shown in the UI. Keys must go in Resources/Localizable.xcstrings…” Based on learnings: “when handling pluralized strings, prefer using localization keys with the ICU-style plural forms .one and .other.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sources/TabManager.swift` around lines 2830 - 2838, The batch-close alert
currently hardcodes English text; change the title and message passed to
confirmClose into localized strings using String(localized:...,
defaultValue:...) and add corresponding keys to Resources/Localizable.xcstrings;
for the plural tab count use an ICU-style plural entry (with .one and .other
variants) instead of manually appending "s" — locate the block guarded by
BatchCloseSettings.isEnabled() that builds count, titleLines and calls
confirmClose and replace the literal title and message with localized variants
that reference the plural key for the tab count and a separate key for the pane
listing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Sources/TabManager.swift`:
- Around line 2904-2918: Batch closes skip pinned-workspace confirmation because
the loop always calls closeWorkspaceIfRunningProcess(...) even when pinned and
confirmations are required; change the loop to call
closeWorkspaceWithConfirmation(workspace) for pinned workspaces when
confirmations are required (i.e., when !batchConfirmed) and only call
closeWorkspaceIfRunningProcess(workspace, requiresConfirmation: !batchConfirmed)
for non-pinned or when batchConfirmed is true. Update the for loop around
plan.workspaces to check workspace.isPinned (or the equivalent property) and
branch accordingly so confirmClosePinnedWorkspace logic is honored.

---

Outside diff comments:
In `@Sources/TabManager.swift`:
- Around line 2866-2878: The code bypasses the running-process confirmation by
calling closeWorkspaceIfRunningProcess(workspace, requiresConfirmation: false)
after a pinned-workspace confirm; change this so the running-process check still
runs—e.g., call closeWorkspaceIfRunningProcess(workspace, requiresConfirmation:
true) or call the variant that uses the default behavior (omit the false
override) so confirmCloseRunningProcess still triggers for workspace.isPinned
paths; update the call site referencing closeWorkspaceIfRunningProcess and the
confirmClose(...) block accordingly.

---

Duplicate comments:
In `@Sources/TabManager.swift`:
- Around line 2830-2838: The batch-close alert currently hardcodes English text;
change the title and message passed to confirmClose into localized strings using
String(localized:..., defaultValue:...) and add corresponding keys to
Resources/Localizable.xcstrings; for the plural tab count use an ICU-style
plural entry (with .one and .other variants) instead of manually appending "s" —
locate the block guarded by BatchCloseSettings.isEnabled() that builds count,
titleLines and calls confirmClose and replace the literal title and message with
localized variants that reference the plural key for the tab count and a
separate key for the pane listing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1e12e6f1-c85e-4ac8-8bd3-fd96b400d70f

📥 Commits

Reviewing files that changed from the base of the PR and between 43a21b1 and 8374bcf.

📒 Files selected for processing (1)
  • Sources/TabManager.swift

When batch confirmation is disabled, route each workspace through
closeWorkspaceWithConfirmation so pinned workspace and running-process
confirmations are each independently honored.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

You’re at about 85% of the monthly review limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Sources/TabManager.swift">

<violation number="1" location="Sources/TabManager.swift:2921">
P2: Non-batch multi-close now bypasses running-process confirmation for pinned workspaces by routing through a helper that forces `requiresConfirmation: false` after pinned confirmation.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

if batchConfirmed {
closeWorkspaceIfRunningProcess(workspace, requiresConfirmation: false)
} else {
_ = closeWorkspaceWithConfirmation(workspace)
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Non-batch multi-close now bypasses running-process confirmation for pinned workspaces by routing through a helper that forces requiresConfirmation: false after pinned confirmation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Sources/TabManager.swift, line 2921:

<comment>Non-batch multi-close now bypasses running-process confirmation for pinned workspaces by routing through a helper that forces `requiresConfirmation: false` after pinned confirmation.</comment>

<file context>
@@ -2915,7 +2915,11 @@ class TabManager: ObservableObject {
+            if batchConfirmed {
+                closeWorkspaceIfRunningProcess(workspace, requiresConfirmation: false)
+            } else {
+                _ = closeWorkspaceWithConfirmation(workspace)
+            }
         }
</file context>
Fix with Cubic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requiresConfirmation: false after pinned-workspace confirmation in closeWorkspaceWithConfirmation is a pre-existing pattern from before this PR. The only change on that line was adding && ClosePinnedWorkspaceSettings.isEnabled() to the condition. The running-process bypass after pinned confirm predates this PR and is out of scope — can be addressed separately if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant